/**
 * @fileoverview Monitor template for the mBot Ranger modification.
 *
 * @license Copyright 2018 The Coding with Chrome Authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @author mbordihn@google.com (Markus Bordihn)
 */
{namespace cwc.soy.mode.makeblock.mBotRanger.Monitor autoescape="strict"}


/**
 * Monitor template.
 */
{template .template}
  {@param prefix: string}

  <div id="{$prefix}body">

    <ul class="mdl-list">
      {call .listEntry_ data="all"}
        {param id: 'lightness' /}
        {param name: 'Light sensor' /}
        {param icon: 'highlight' /}
      {/call}

      {call .listEntry_ data="all"}
        {param id: 'linefollower' /}
        {param name: 'Line follower sensor' /}
        {param icon: 'timeline' /}
      {/call}

      {call .listEntry_ data="all"}
        {param id: 'temperature' /}
        {param name: 'Temperature sensor' /}
        {param icon: 'whatshot' /}
      {/call}

      {call .listEntry_ data="all"}
        {param id: 'ultrasonic' /}
        {param name: 'Ultrasonic sensor' /}
        {param icon: 'wifi' /}
      {/call}
    </ul>

  </div>
{/template}


/**
 * List entry
 */
{template .listEntry_ private="true"}
  {@param prefix: string}
  {@param id: string}
  {@param name: string}
  {@param? icon: string}

  <li class="mdl-list__item">
    <span class="mdl-list__item-primary-content">
      <i class="material-icons mdl-list__item-icon">
        {if $icon}{$icon}{else}input{/if}
      </i>
      <span>{$name}</span>
    </span>
    <span id="{$prefix}{$id}-value" class="mdl-list__item-secondary-action">
      ...
    </span>
  </li>
{/template}
